package com.hashmap;

import java.util.HashMap;
import java.util.Scanner;

public class HashMapTestt {
    public static void main(String[] args) {
        HashMap<Character,Integer> hashMap = new HashMap();
        int max = 0;
        Scanner sc = new Scanner(System.in);
        System.out.println("输入几个数字");
        String s = sc.nextLine();
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (hashMap.containsKey(c)) {
                Integer getNum = hashMap.get(c);
                getNum++;
                if (getNum > max) {
                    max = getNum;
                }
                hashMap.put(c,hashMap.get(c) + 1);
            } else {
                hashMap.put(c,1);
            }
        }
        for (Character character : hashMap.keySet()) {
            if (hashMap.get(character).equals(max)) {
                System.out.println(character);
            }
        }
    }
}
